\name{normxcorr}
\alias{normxcorr}
\title{ Normalized Cross-correlation }
\description{
Normalized cross-correlation function using the Fast Fourier Transform.
}
\usage{
normxcorr(x, T)
}
\arguments{
  \item{x}{ the vector or matrix whose columns are being searched for the
            template match. }

  \item{T}{ the template being search for in \code{x}. }
}
\details{
  The number of rows of \code{x} must be larger than or equal to the number of
  rows of \code{T}.

  The number of columns of \code{x} and \code{T} can differ in which case they
  are recycled as necessary.
}
\value{
  The output vector / matrix contains the normalized cross-correlation
  coefficients. Values range between -1.0 and 1.0.

  For vector valued inputs, a vector of length equal to
  \code{length(x) + length(T) - 1}.

  For matrices or a combination of vector and matrix inputs, a matrix with
  \code{NROW(x) + NROW(T) - 1} rows and \code{max(NCOL(x), NCOL(T))} columns.
}
\references{
}
\author{ Christophe Tournery }
\seealso{ \code{xcorr}, \code{\link{conv}}, \code{\link{convolve}}, \code{\link{fft}},
  \code{\link{ifft}}, \code{\link{fftfilt}}, \code{\link{poly}} }
\examples{
x <-    c(1,1,0,1,1)
T <-    c(1,0,1)
normxcorr(x,T)                                  # vector / vector
normxcorr(cbind(x,2*x,3*x,4*x), T)              # matrix / vector
normxcorr(x, cbind(T, 2*T))                     # vector / matrix
normxcorr(cbind(x,2*x,3*x,4*x), cbind(T,5*T))   # matrix / matrix
}
\keyword{ math }

